<div class="pagination text-center">
    {*  如果当前页大于1，可以显示上一页按钮  *}
    {if $list.page > 1}
    <a class="page-item" href="{$pageUrl}?{if !empty($CMS_PAGE_SEARCH_KEYWORD)}keyword={$CMS_PAGE_SEARCH_KEYWORD}&{/if}page={$list.page-1}"><i class="fa fa-chevron-left"></i></a>
    {/if}
    {if $list.pages <= 10}
    {*  如果页数在10以内，直接输出所有页按钮  *}
    {for $page=1 to $list.pages}
    <a class="page-item {if $list.page==$page}current{/if}" href="{$pageUrl}?{if !empty($CMS_PAGE_SEARCH_KEYWORD)}keyword={$CMS_PAGE_SEARCH_KEYWORD}&{/if}page={$page}">{$page}</a>
    {/for}
    {else}
    {*  如果页数在10以上  *}
    {if $list.page > 3}
    <a class="page-item" href="{$pageUrl}{if !empty($CMS_PAGE_SEARCH_KEYWORD)}?keyword={$CMS_PAGE_SEARCH_KEYWORD}{/if}">1</a>
    {/if}
    {if $list.page > 4}
    <a class="page-item prev" href="{$pageUrl}{if !empty($CMS_PAGE_SEARCH_KEYWORD)}?keyword={$CMS_PAGE_SEARCH_KEYWORD}{/if}&page={$list.page-5}"></a>
    {/if}
    {if $list.page < 4}
    {for $page=1 to 5}
    <a class="page-item {if $list.page==$page}current{/if}" href="{$pageUrl}?{if !empty($CMS_PAGE_SEARCH_KEYWORD)}keyword={$CMS_PAGE_SEARCH_KEYWORD}&{/if}page={$page}">{$page}</a>
    {/for}
    {elseif $list.page <= $list.pages - 4}
    {for $page=$list.page-2 to $list.page+2}
    <a class="page-item {if $list.page==$page}current{/if}" href="{$pageUrl}?{if !empty($CMS_PAGE_SEARCH_KEYWORD)}keyword={$CMS_PAGE_SEARCH_KEYWORD}&{/if}page={$page}">{$page}</a>
    {/for}
    {elseif $list.page > $list.pages - 4}
    {for $page=$list.pages-4 to $list.pages}
    <a class="page-item {if $list.page==$page}current{/if}" href="{$pageUrl}?{if !empty($CMS_PAGE_SEARCH_KEYWORD)}keyword={$CMS_PAGE_SEARCH_KEYWORD}&{/if}page={$page}">{$page}</a>
    {/for}
    {/if}
    {if $list.page <= $list.pages - 4}
    <a class="page-item next" href="{$pageUrl}?{if !empty($CMS_PAGE_SEARCH_KEYWORD)}keyword={$CMS_PAGE_SEARCH_KEYWORD}&{/if}page={$list.page+5}"></a>
    {/if}
    {if $list.page < $list.pages - 3}
    <a class="page-item" href="{$pageUrl}?{if !empty($CMS_PAGE_SEARCH_KEYWORD)}keyword={$CMS_PAGE_SEARCH_KEYWORD}&{/if}page={$list.pages}">{$list.pages}</a>
    {/if}
    {/if}
    {*  如果当前页不是最大页，可以显示下一页按钮  *}
    {if $list.page < $list.pages}
    <a class="page-item" href="{$pageUrl}?{if !empty($CMS_PAGE_SEARCH_KEYWORD)}keyword={$CMS_PAGE_SEARCH_KEYWORD}&{/if}page={$list.page +1}"><i class="fa fa-chevron-right"></i></a>
    {/if}
</div>